<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var mySqrt = function(x) {
				var re = 0;
				while (!(re * re <= x && (re + 1) * (re + 1) > x)) {
					re++;
				}
				return re
			};
			console.log(mySqrt(9));
		</script>
	</body>
</html>
